package mybatis.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;

import mybatis.entity.Student;
import mybatis.service.IMybatisService;

@Controller(value = "/student")
public class MybatisController {
    @Autowired
    private IMybatisService mybatisService;

    @ResponseBody
    @RequestMapping(value = "/getList")
    public String getStudentList() {
        return JSON.toJSONString(mybatisService.getStudents());
    }

}
